home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d885.lha / False / src / lambda.f < prev    next >
Text File  |  1993-07-16  |  563b  |  38 lines

  1. { lambda calculus in FALSE
  2.   [] blocks are lambda functions already, so it isn't all that hard... }
  3.  
  4. [\%]a:        { true }
  5. [%]b:        { false }
  6. [a;b;@!]d:    { not }
  7. [b;@@\!]e:    { and }
  8. [\a;\!]f:    { or }
  9. [$d;!\@!]g:    { xnor }
  10.  
  11. [$a;=["true"10,]?b;=["false"10,]?]z:    { print true/false for funcs a/b }
  12.  
  13. "not testcase:
  14. "
  15. a;d;!z;!
  16. b;d;!z;!
  17.  
  18. "and testcase:
  19. "
  20. a;a;e;!z;!        { this would be: print(and(true,true)) }
  21. a;b;e;!z;!
  22. b;a;e;!z;!
  23. b;b;e;!z;!
  24.  
  25. "or testcase:
  26. "
  27. a;a;f;!z;!
  28. a;b;f;!z;!
  29. b;a;f;!z;!
  30. b;b;f;!z;!
  31.  
  32. "xnor testcase:
  33. "            { equality }
  34. a;a;g;!z;!
  35. a;b;g;!z;!
  36. b;a;g;!z;!
  37. b;b;g;!z;!
  38.